package wzh.crm.ui.product;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;

import java.io.Serializable;

import wzh.crm.ui.DisplayListItemView;
import wzh.crm.vo.ProductVo;

/**
 * Created by wangzehao on 2016/5/23.
 */
public class ProductListItem extends DisplayListItemView<ProductVo> {
    public ProductListItem(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setModel(final ProductVo model) {
        super.setModel(model);
        this.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i=new Intent(getContext(),ProductDetailsActivity.class);
                i.putExtra("MODEL",model);
                getContext().startActivity(i);
            }
        });

        this.setTitle(model.getProductname());
        this.setDetail("");
    }
}
